package com.rafael.teste.conexao;

import org.hibernate.Session;

import com.rafael.teste.util.HibernateUtil;

public class TesteConexaoHibernate {
	public static void main(String[] args) {
		Session  sessao = null;
		try {
			sessao = new HibernateUtil().getSession();
			sessao.beginTransaction();
			System.out.println("Conectou !");
		}finally{
			sessao.close();
			System.out.println("Fechou conexão!");
		}
	}
}
